#define _CRT_SECURE_NO_WARNINGS 1
vector<int> nums(10);  // nums is nonconst

const vector<int>::iterator cit = nums.begin();

*cit = 1;                 // ok: cit can change its underlying element

++cit;                    // error: can't change the value of cit

const vector<int> nines(10, 9);  // cannot change elements in nines

// error: cit2 could change the element it refers to and nines is const

const vector<int>::iterator cit2 = nines.begin();

// ok: it can't change an element value, so it can be used with a const vector<int>

vector<int>::const_iterator it = nines.begin();

*it = 10; // error: *it is const

++it;     // ok: it isn't const so we can change its value

// an iterator that cannot write elements

vector<int>::const_iterator

// an iterator whose value cannot change

const vector<int>::iterator